export default {
    namespaced: true,
    state: {
        isShowToast: false,
        toastMsg: "",
        // toast的类型(success, danger, info)
        toastType: "success"
    },
    mutations: {
        changeisShowToast(state, payload) {
            state.isShowToast = payload['isshow'];
            state.toastMsg = payload['msg'];
            state.toastType = payload['type'];
        }
    },
    actions: {
        asyncisshowtoast({ commit }, payload) {
            commit('changeisShowToast', {
                isshow: true,
                msg: payload.msg,
                type: payload.type
            })
            setTimeout(() => {
                commit('changeisShowToast', {
                    isshow: false
                })
            }, 2000)
        }
    }
}